package keter.starter.demo;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@ConfigurationProperties(prefix = "keter.demo") // 自动获取配置文件中的属性，把值传入对象参数
@Component
public class Demo {

    public String getUrl() {
        logger.info("get url!");
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    private static final Logger logger = LoggerFactory.getLogger(Demo.class);
    @Value("${url:haha}")
    private String url;

}
